import request from '@/utils/request'

// 查询自我评价结果列表
export function listEvaluation(query) {
  return request({
    url: '/evaluation/comEvaluation/list',
    method: 'get',
    params: query
  })
}

// 查询自我评价结果详细
export function getEvaluation(id) {
  return request({
    url: '/evaluation/comEvaluation/' + id,
    method: 'get'
  })
}

// 新增自我评价结果
export function addEvaluation(data) {
  return request({
    url: '/evaluation/comEvaluation',
    method: 'post',
    data: data
  })
}

// 保存评价结果
export function saveComEvaluation(memberId, evaluateId, score, content){
  return request({
    url: '/evaluation/comEvaluation/save/' + memberId + "/" + evaluateId,
    method: 'get',
    params: {
      score: score,
      content: content
    }
  })
}

// 修改自我评价结果
export function updateEvaluation(data) {
  return request({
    url: '/evaluation/comEvaluation',
    method: 'put',
    data: data
  })
}

// 删除自我评价结果
export function delEvaluation(id) {
  return request({
    url: '/evaluation/comEvaluation/' + id,
    method: 'delete'
  })
}
